Skip to content

test: deflake test_pre_existing_request_with_user_data in single RQ mode#959

Merged
vdusek merged 1 commit into
masterfrom
test/deflake-pre-existing-request-user-data
Jun 12, 2026
Merged

test: deflake test_pre_existing_request_with_user_data in single RQ mode#959
vdusek merged 1 commit into
masterfrom
test/deflake-pre-existing-request-user-data

Conversation

@vdusek

@vdusek vdusek commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Deflakes test_pre_existing_request_with_user_data[single], which intermittently failed in CI with assert None is not None (e.g. this run).

Root cause

The test adds a request via a different producer (the raw apify_client_async client), then fetches it with the single-mode client under test. In single mode the rq_poll_timeout fixture is 0, so poll_until_condition calls fetch_next_request exactly once — a single list_head API call with no retry. Single-mode "reads are immediately consistent" only holds for the client's own writes; an external producer's write that hasn't yet propagated to list_head returns None, and with zero retries the assertion fails.

Fix

Poll with a generous 30s ceiling regardless of access mode (matching what shared mode already does), instead of rq_poll_timeout=0. The now-unused rq_poll_timeout parameter is dropped. The [shared] parametrization already used timeout=30 and was unaffected.

The request is added by a different producer, so single-mode immediate consistency does not apply; poll up to 30s for the write to propagate instead of relying on rq_poll_timeout (0 in single mode).
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 11, 2026
@vdusek vdusek self-assigned this Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.04%. Comparing base (a87e8d1) to head (ec07218).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #959      +/-   ##
==========================================
+ Coverage   90.00%   90.04%   +0.03%     
==========================================
  Files          49       49              
  Lines        3053     3053              
==========================================
+ Hits         2748     2749       +1     
+ Misses        305      304       -1     
Flag Coverage Δ
e2e 35.66% <ø> (ø)
integration 56.89% <ø> (+0.03%) ⬆️
unit 78.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Pijukatel June 11, 2026 11:06
@vdusek vdusek merged commit db780d6 into master Jun 12, 2026
28 checks passed
@vdusek vdusek deleted the test/deflake-pre-existing-request-user-data branch June 12, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants